from rest_framework.serializers import ModelSerializer
from .models import Banner,Nav


class BannerSerializers(ModelSerializer):
    """轮播广告的序列化器"""
    # 模型序列化器字段声明
    class Meta:
        model = Banner
        fields = ['image_url', 'link']


class NavModelSerializer(ModelSerializer):
    """导航菜单序列化器"""
    class Meta:
        model = Nav
        fields = ["title","link","is_site"]